<template>
  <div id="demo" ref="pdfBox">
<!--    <pdf-->
<!--        v-for="i in numPages"-->
<!--        :key="i"-->
<!--        :src="pdfSrc"-->
<!--        :page="i"-->
<!--        id="pdf"-->
<!--    >-->
<!--    </pdf>-->
  </div>
</template>
<script>
// import pdf from 'vue-pdf'
// import Hammer from 'hammerjs'
import Pdfh5 from "pdfh5";
import "pdfh5/css/pdfh5.css";

export default {
name: "demo",
  components: { },

  data() {
    return {
      ServerUrl: process.env.VUE_APP_BASE_API,
      pdfSrc: '',
      numPages: undefined,
      lastdeltaX: 0,
      pdfh5: null
    };
  },
  mounted() {
    // this.pdfSrc = this.ServerUrl + '/file/export/pdf?fileid=' + this.info.id + '#toolbar=0'
    this.pdfSrc = 'http://www.ccvi.top:6008/file/export/pdf?fileid=844#toolbar=0'
    this.pdfh5 = new Pdfh5("#demo", {
      pdfurl: "http://www.ccvi.top:6008/file/export/pdf?fileid=844#toolbar=0"
    });
    //监听完成事件
    this.pdfh5.on("complete", function (status, msg, time) {
      console.log("状态：" + status + "，信息：" + msg + "，耗时：" + time + "毫秒，总页数：" + this.totalNum)
    })
  },
  methods: {

  }
}
</script>

<style scoped>
#box{
  width: 100%;

}
</style>